Skip to content

Fix project name prompt placeholder leak#466

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/fix-create-name-placeholder
Jun 8, 2026
Merged

Fix project name prompt placeholder leak#466
tannerlinsley merged 1 commit into
mainfrom
taren/fix-create-name-placeholder

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the interactive project-name prompt so pressing Enter for the current directory no longer lets the placeholder text leak into validation.

Details

The prompt used Clack's placeholder for the current-directory hint. In this edge case, the placeholder could be treated like input after Enter, then validated as a project name and duplicated in the prompt output. The hint now lives in the prompt message, and the project-name prompt no longer sets a placeholder.

Validation

  • pnpm --filter @tanstack/cli test -- ui-prompts
  • pnpm --filter @tanstack/cli build
  • Commit hook: nx run-many --target=build --parallel 5
  • Commit hook: pnpm test:unit && pnpm test:e2e

Summary by CodeRabbit

  • Documentation
    • Enhanced the project name prompt messaging to provide clearer guidance during setup. The prompt now explicitly indicates that you can leave the name field empty to use the current directory as your project location, making this functionality more discoverable and intuitive for new users.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6245ec3b-1fbf-46bf-ac1d-9d18815f522c

📥 Commits

Reviewing files that changed from the base of the PR and between 6880123 and ce421fc.

📒 Files selected for processing (2)
  • packages/cli/src/ui-prompts.ts
  • packages/cli/tests/ui-prompts.test.ts

📝 Walkthrough

Walkthrough

The PR updates the interactive prompt message for project name input in the TanStack CLI from "What would you like to name your project?" to "Project name (leave empty to use current directory)", with the placeholder text removed. The corresponding test assertions are updated to validate the new prompt text and expect no placeholder.

Changes

Prompt Message Update

Layer / File(s) Summary
Prompt message and test update
packages/cli/src/ui-prompts.ts, packages/cli/tests/ui-prompts.test.ts
The getProjectName() prompt message is changed to clarify that empty input will use the current directory, and the placeholder is removed. The test is updated to assert the new message and expect placeholder to be undefined.

Possibly Related PRs

  • TanStack/cli#458: Both PRs update the getProjectName() interactive prompt (including the "current directory/empty input" placeholder/message) and its ui-prompts.test.ts assertions to support current-directory project creation.

Poem

🐰 A prompt so clear, a message bright,
"Leave it blank," we say, "and all is right!
The current home, just waiting there,
No extra text to fill the air—
A simpler ask, a gentler care! ✨

🎯 1 (Trivial) | ⏱️ ~2 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/fix-create-name-placeholder

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/cli/tests/ui-prompts.test.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): packages/cli/tests/ui-prompts.test.ts


Comment @coderabbitai help to get the list of available commands and usage tips.

@tannerlinsley tannerlinsley marked this pull request as ready for review June 8, 2026 05:58
@tannerlinsley tannerlinsley merged commit 9b097c9 into main Jun 8, 2026
6 of 7 checks passed
@tannerlinsley tannerlinsley deleted the taren/fix-create-name-placeholder branch June 8, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant